//======================================================================================
//  Apache License, Version 2.0
//  Notes:Use this command to anonymously check out the latest project source code:
//  Non-members may check out a read-only working copy anonymously over HTTP.
//  SVN checkout http://YHHLineCreateByGsdWsp.googlecode.com/svn/trunk/ 
//
//  Author:		Kevin Yang
//  Email:		Bigearrabbit@qq.com
//
//  DATE:		2013-4-6
//
//  File Name:	
//
//  Notes:
//
//======================================================================================
#ifndef YHHLineCreateByGsdDlg_H
#define YHHLineCreateByGsdDlg_H


// Dialog Framework
#include "CATDlgDialog.h"  // needed to derive from CATDlgDialog
#include "CATDlgInclude.h" // needed to use Dialog framework objects

#include "CATDialogAgent.h" 

//Local Framework
#include "YHHLineCreateByGsdParamDlg.h"
#include "YHHLineCreateByGsdParam.h"

//YHHCatiaBaseUtlFrm
#include "YHHPropertyDefine.h"

namespace YHHLineCreateByGsd
{
	/// <summary>Field Type</summary>
	/// <author>Kevin Yang</author>
	/// <date>2013-4-2</date>
	enum FieldType
	{
		FieldNone,
		FieldStartpoint,
		FieldLineDirection
	};
}
typedef YHHLineCreateByGsd::FieldType YHHLineCreateByGsdField;//alias type name

/// <summary>main Dialog</summary>
/// <return></return>
/// <remarks></remarks>
/// <author>Kevin Yang</author>
/// <date>2013-4-7</date>
class YHHLineCreateByGsdDlg: public CATDlgDialog
{
    
    DeclareResource(YHHLineCreateByGsdDlg,CATDlgDialog);

public:
    
    YHHLineCreateByGsdDlg();
    virtual ~YHHLineCreateByGsdDlg();
    
    /**
    * Builds the panel with its control.
    */
    void Build ();
public:

	/// <summary>ActiveField define</summary>
	/// <remarks></remarks>
	/// <author>Kevin Yang</author>
	/// <date>2013-4-7</date>
	YHHPropertyDefineGetCopy(ActiveField,YHHLineCreateByGsdField);

	/// <summary>Param Dialog pointer define</summary>
	/// <remarks></remarks>
	/// <author>Kevin Yang</author>
	/// <date>2013-4-7</date>
	YHHPropertyDefinePointerGetGet(ParamDlg,YHHLineCreateByGsdParamDlg);

	/// <summary>param pointer define</summary>
	/// <remarks></remarks>
	/// <author>Kevin Yang</author>
	/// <date>2013-4-7</date>
	YHHPropertyDefinePointerGetGetSet(ParamGsd,YHHLineCreateByGsdParam);
public:
	/**
	* Returns the field_number-th field of the panel.
	*/
	CATDlgSelectorList* GetField(YHHLineCreateByGsdField iFieldNumber );

	/**
    * Sets the focus on the active entry field ( one of the four fields for Curve.1 to Direction.2 )
    */
	void SetActiveField( YHHLineCreateByGsdField iFieldNumber );

	/// <summary>Focus current field</summary>
	/// <remarks></remarks>
	/// <author>Kevin Yang</author>
	/// <date>2013-4-7</date>
	void SetActiveFieldFocus();

	/// <summary>Set Accept On Notify Of Value Change</summary>
	/// <param name="ipDialogAgent">Value Change Agent</param>
	/// <remarks></remarks>
	/// <author>Kevin Yang</author>
	/// <date>2013-4-5</date>
	void SetAcceptOnNotifyOfValueChange(CATDialogAgent * ipDialogAgent);

    /**
    * Writes name in the field_number-th field.
    */
    void SetName( YHHLineCreateByGsdField iFieldNumber , CATUnicodeString iName );
    
	/// <summary>Set Params to Dialog</summary>
	/// <remarks></remarks>
	/// <author>Kevin Yang</author>
	/// <date>2013-4-2</date>
	void UpdateDialog();
	
	/// <summary>Update Params From Dialog</summary>
	/// <remarks></remarks>
	/// <author>Kevin Yang</author>
	/// <date>2013-4-2</date>
	void UpdateInfos();

	/// <summary>Update dialog Sensitivity</summary>
	/// <return></return>
	/// <remarks></remarks>
	/// <author>Kevin Yang</author>
	/// <date>2013-4-7</date>
	void UpdateSensitivity();

	
protected://Inset positon for THE CAA2 WIZARD : protected:

	/// <summary>Sign Button</summary>
	virtual void OnPushButtonLengthSignPushBActivateNotification (CATCommand *, CATNotification* , CATCommandClientData data);

	/// <summary>More infors</summary>
	/// <author>Kevin Yang</author>
	/// <date>2013-4-2</date>
	virtual void OnPushButtonMorePushBActivateNotification (CATCommand *, CATNotification* , CATCommandClientData data);



private:
	CATUnicodeString	m_NoSelectionMsg;//no select msg
//CAA2 WIZARD WIDGET DECLARATION SECTION
 CATDlgFrame*      _FrameMain;
 CATDlgLabel*      _LabelLengthValue;
 CATDlgSpinner*      _SpinnerLengthValue;
 CATDlgPushButton*      _PushButtonMore;
 CATDlgSelectorList*      _SelectorListStartPoint;
 CATDlgLabel*      _LabelStartPoint;
 CATDlgLabel*      _LabelLineDirection;
 CATDlgSelectorList*      _SelectorListLineDirection;
 CATDlgPushButton*      _PushButtonLengthSign;
//END CAA2 WIZARD WIDGET DECLARATION SECTION

};

#endif

